import sys
import os
import requests

# sys.path.append("..")
# sys.path.append("../utils")
# os.environ.update({"DJANGO_SETTINGS_MODULE": "server.settings"})
# django.setup()
# from django.test import Client

# client = Client()

baseUrl = u"http://127.0.0.1:8000/api/need/"




def addNeed():
    iputData = {
        "title":"百度",
        "needContent":"百度",        
        "softwareVersionId":"1",
        "token":"80dd9bc3de1a768f6d41",
    }
    res = requests.post(baseUrl + 'raise/', data=iputData)
    print(res.content)

def getNeedList():
    iputData = {
        'page':'1',
        'maxItem' : '5',        
        "softwareVersionId":"1",
        "token":"24af9e53417b3d766552",
        "needState":0,          
    }
    res = requests.post(baseUrl + 'list/', data=iputData)
    print(res.content)

def needOption():
    iputData = {       
        "needId":"1",
        "token":"61aa3da28253d3877c20",
        "option":0,
        "verify":0,
        "result":'增加了',                         
    }
    res = requests.post(baseUrl + 'option/', data=iputData)
    print(res.content)

def needScreen():
    iputData = {       
        "token":"80dd9bc3de1a768f6d41",
        'page':'1',
        'maxItem' : '5', 
        "warZoneId":'',
        "companyId":'',
        "storehouseId":'', 
        "key":'google',
        "needState":0,                         
    }
    res = requests.post(baseUrl + 'screen/', data=iputData)
    print(res.content)

def needAnnounce():
    iputData = {     
        "noticeId":"27",
        "token":"80dd9bc3de1a768f6d41",                 
    }
    res = requests.post(baseUrl + 'onedemand/', data=iputData)
    print(res.content)

if __name__ == '__main__':
    # addNeed()
    # getNeedList()
    # needOption()
    # needScreen()
    needAnnounce()